package com.elsa.auth.properties;

import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;

/**
 * @projectName：elsa-auth
 * @typeName：ElsaAuthProperties
 * @author：cos
 * @date：2021年5月11日
 * @version
 * @desc：Auth相关的配置类
 */
@SpringBootConfiguration
//指定读取的配置文件路径；
@PropertySource(value = {"classpath:elsa-auth.properties"})
//指定了要读取的属性的统一前缀名称为elsa.auth；
@ConfigurationProperties(prefix = "elsa.auth")
public class ElsaAuthProperties {
    private ElsaClientsProperties[] clients = {};
    //指定access_token的有效时间，默认值为60 * 60 * 24秒；
    private int accessTokenValiditySeconds = 60 * 60 * 24;
    //指定refresh_token的有效时间，默认值为60 * 60 * 24 * 7秒。
    private int refreshTokenValiditySeconds = 60 * 60 * 24 * 7;
	public ElsaClientsProperties[] getClients() {
		return clients;
	}
	public void setClients(ElsaClientsProperties[] clients) {
		this.clients = clients;
	}
	public int getAccessTokenValiditySeconds() {
		return accessTokenValiditySeconds;
	}
	public void setAccessTokenValiditySeconds(int accessTokenValiditySeconds) {
		this.accessTokenValiditySeconds = accessTokenValiditySeconds;
	}
	public int getRefreshTokenValiditySeconds() {
		return refreshTokenValiditySeconds;
	}
	public void setRefreshTokenValiditySeconds(int refreshTokenValiditySeconds) {
		this.refreshTokenValiditySeconds = refreshTokenValiditySeconds;
	}
    
}
